Managing query subscription renewals in a messaging platform

ABSTRACT

This disclosure relates to streaming real-time messages over time to client applications according to query subscriptions that match content from a large stream of messages exchanged on a messaging platform in a manner that increases the speed of message delivery, effectively controls the management of computer resources to handle the fluctuation of the number of active query subscriptions, and/or increases the security of matching the query subscriptions against messages generated from the perspective of the authors while delivering those messages in real-time from the perspective of the users that initiated the query subscriptions.

CROSS-REFERENCE TO RELATED APPLICATION

This application claims priority to U.S. Provisional Application No.62/883,633, filed on Aug. 6, 2019, entitled “Query Subscription in aMessaging Platform for Delivering Real-Time Messages”, the contents ofwhich are hereby incorporated by reference in its entirety.

BACKGROUND

A social media messaging platform may facilitate the exchange ofmillions or hundreds of millions of social media messages among itsusers. The messages exchanged on the platform often can provide users ofthe platform the latest update or reporting on current events. In someexamples, a user may submit a search on the platform and receive astream of results such that the user can view messages over time thatmatch one or more keywords. However, matching messages in a very largemessage stream over a period of time while rendering those messages tothe user in real-time involve complex and technique technical challengessuch as processing speed, computer resource allocation, and securityissues.

SUMMARY

This disclosure relates to streaming real-time messages over time toclient applications according to query subscriptions that match contentfrom a large stream of messages exchanged on a messaging platform in amanner that increases the speed of message delivery, effectivelycontrols the management of computer resources to handle the fluctuationof the number of active query subscriptions, and/or increases thesecurity of matching the query subscriptions against messages generatedfrom the perspective of the authors while delivering those messages inreal-time from the perspective of the users that initiated the querysubscriptions.

To establish an active query in which the client application begins toreceive a stream of messages relating to the active query, the clientapplication may generate and send a query subscription request (e.g., aGraphQL subscription query), over a network to a subscription executor(e.g., a GraphQL engine) of the messaging platform to cause thesubscription executor to generate a query subscription and provide thequery subscription to an event producer system of the messagingplatform. Also, the client application may generate and send a subscriberequest to a transport engine to create a delivery channel between theclient application and the transport engine. The messages matched by theevent producer system may be streamed to the client application via thedelivery channel. In this manner, the management of query subscriptionsis separated from the delivery of messages by using two separatemodules, e.g., the subscription executor, the transport engine, whichmay increase the speed of delivery from query creation to the matchingand then rendering of real-time messages to the client. Also, in someexamples, since two subscriptions are generated (e.g., one at thesubscription executor, and one at the transport engine), this maysuggest that the client application would have to renew at both thesubscription executor and the transport module. However, as discussedlater in the disclosure, the client application may renew with thetransport engine, and the structure of the messaging platform may causethe query subscription to be renewed at the transport engine and thesubscription executor, thereby decreasing the amount of communicationtransmitted between the client application and the messaging platform tomaintain the query subscription. Furthermore, the messaging platform maybe capable of executing query subscriptions from thousands of clientapplications against a large message stream (e.g., over 50 k messagesper second) and delivering tens of thousands of messages per second tothe client applications.

The user may not be required to refresh the user interface or submitanother request view new messages on the user interface, but rather themessages are pushed to the user interface of the user in response toother users posting messages on the messaging platform that match thequery subscription. For example, the user may enter a search term suchas “dog” to generate an active query, and then receive a stream ofmessages that include the search term “dog” and continue to receivemessages that include the search term “dog” as new messages are createdand posted to the messaging platform until the active query expires. Asopposed to a static query in which results are provided once around thetime of submitting the static query (e.g., receiving a list of webresults in response to a search request), the user may continue to viewmatched content after the submission of the active query (and until theactive query expires).

The event producer system includes an event producer manager and aplurality of event producers configured to simultaneously execute querysubscriptions to identifying matching content. The event producermanager receives a query subscription from the subscription executor andassigns the query subscription to one or more event producers such thatthe query subscription is stored at the assigned event producer. In someexamples, the event producer manager may manage the configuration of theevent producers, e.g., causing the storage and removal of querysubscriptions, to control the computing resources at the event producersystem. For example, the event producer manager may remove expired (orfaulty) query subscriptions from the event producers and assign newquery subscriptions as they are received at the event producer manager.The assigned event producer generates a response event in response to amessage from a message queue matching the query subscription. Theresponse event may identify the message having content that is matchedwith the query subscription.

The subscription executor receives the response events, generates themessages identified by the response events with data from theperspective of the user that initiated the query subscription, andprovides the messages to the transport engine to be delivered via thedelivery channel. For example, the messages in the message queue havebeen generated from the perspective of their authors. However, themessages delivered to the client applications may be required to havedata from the perspective of the users that initiated the requests. Thesubscription executor may generate the messages (e.g., hydrate and applyvisibility rules to the messages) after they have been matched by theevent producer system but before delivery by the transport engine. Inthis manner, if an author of a matched message has restricted (e.g.,blocked or muted) the user that initiated the query subscription, thesubscription executor may discard that message, thereby increasing thesecurity of the messaging platform. Furthermore, in some examples, sincethe response event may only include the data that the user had requestedfor the subscription, the amount of data published on an event bus maybe decreased, causing no extra data sent to the client which may helpsave bandwidth to stream more events per second.

In some examples, the event producers may be grouped into a plurality ofevent producer groups, where each event producer group receives the fullmessage stream. Each producer group includes a plurality of eventproducers, where each event producer receives a separate portion of thefull message stream. Each event producer group is allocated a separateportion of the query subscriptions. The event producer manager mayassign a subscription query to an event producer group, where each eventproducer in the group stores and executes the query subscription. Insome examples, the event producer manager may assign a subscription to afirst event producer group and a second event producer group such thatthe query subscription can be maintained if there is an error atprocessing the query subscription at one of the event producer groups.In this manner, the system can easily control the amount of responses atthe event producer system by increasing or decreasing the number ofevent producer groups and/or increasing or decreasing the number ofevent producers in each group to account for the fluctuating amount ofquery subscriptions and response events. For instance, in response tothe number of event producers in a single event producer group beingincreased, each individual event producer may receive fewer messagesfrom the message stream to process and consequently may have morecomputational capacity to handle extra searches. In response to thenumber of event producer groups being increased, the number of searchterms allocated to the event producer may be reduced.

In some examples, the event producer system includes a collector servicethat receives the response events from the event producers and discardsone or more response events to control a streaming rate such that themessages identified by the response events are streamed to the clientapplication in a manner that is equal to or below a streaming ratethreshold. For example, if the messages are streamed at a fast rate, theuser may not be able to consume the streamed messages. As such, thecollector service may throttle the streaming rate so that the rate atwhich the messages are streamed is equal to or less than a thresholdlevel. For example, if the streaming rate threshold is 10 messages persecond, the collector service may discard response events over 10 withina one second time interval. In some examples, the collector service maydiscard messages based on other attributes besides the time of when theresponse events are generated. For example, the collector service maydiscard messages predicated as low quality or abusive to provide themessages at a streaming rate that is less than the threshold. In someexample, the collector service may discard messages that are predictedto have low engagements to provide the messages at a streaming rate thatis less than the threshold. These and other features are furtherdiscussed in the detailed disclosure.

In some examples, the collector service receives status responses fromthe event producers and stores the status responses in a memory cache.The collector service may determine a health of the query subscriptionby periodically querying the memory cache for the status responses. Ifthe collector service determines that the query subscription isrepairable, the collector service may provide subscription data to oneor more event producers reporting as faulty such that the querysubscription can be repaired.

According to an aspect, a system for processing query subscriptions in amessaging platform includes a queue including a stream of messagesexchanged on the messaging platform executable by a server computer,where the messaging platform is configured to stream messages to a userinterface of a client application executable by a computing device. Thesystem includes a plurality of event producers, and an event producermanager configured to receive a query subscription and assign the querysubscription to one or more of the plurality of event producers, whereeach event producer is configured to generate a response event inresponse to a message from the steam of messages satisfying the querysubscription. The system includes a collector service configured toreceive status responses from the plurality of event producers and storethe status responses in a memory cache, where the collector service isconfigured to periodically determine a health status of the querysubscription by querying the status responses in the memory cache. Inresponse to the health status being determined as repairable, thecollector service is configured to obtain subscription data relating tothe subscription query from the memory cache and provide thesubscription data to one or more event producers to restart the querysubscription.

According to some aspects, the system may include one or more of thefollowing features (or any combination thereof). The event producermanager includes an application programming interface (API) configuredto receive the query subscription via a thrift call. The event producermanager is configured to monitor a number of query subscriptionsprocessed at the plurality of event producers and a size of the messagestream, and to adjust a number of the plurality of event producers basedon the number of query subscriptions and the size of the message stream.The plurality of event producers are arranged in event producer groups,and the event producer manager is configured to assign the querysubscription to a first event producer group and a second event producergroup. The plurality of event producers are arranged in event producergroups, and the event producer manager is configured to assign the querysubscription to at least one event producer group based on a useridentifier associated with the query subscription. The collector serviceis configured to receive response events from the event producers, storethe response events in the memory cache, and publish the response eventson a response event bus.

In response to receipt of new response event, the collector service isconfigured to determine whether the response events for the querysubscription has exceeded a streaming rate threshold by querying thememory cache, where the collector service is configured to discard thenew response event in response to the streaming rate threshold beingexceeded. In response to receipt of a new response event, the collectorservice is configured to determine whether the message identifier of thenew response event is stored in the memory cache, where the collectorservice is configured to publish the new response event on the responseevent bus and store the new response event in the memory cache inresponse to the message identifier not being stored in the memory cache.The collector service is configured to discard the new response event inresponse to the message identifier being stored in the memory cache. Theplurality of event producers are arranged in event producer groups, andeach event producer group includes a number of event producers such thatthe message stream is allocated between the event producers of arespective group.

The system includes a subscription executor configured to transmit thequery subscription to the event producer manager in response to receiptof a query subscription request received over a network from the clientapplication, and a transport engine configured to create a deliverychannel between the transport engine and the client application inresponse to receipt of a subscribe request received over the networkfrom the client application such that messages identified by theresponse events are streamed, via the delivery channel, to the clientapplication during a period of time in which the query subscription isactive. The event producer manager is configured to delete the querysubscription at each of the plurality of event producers for theassigned group in response to expiration of the query subscription.

According to an aspect, a non-transitory computer-readable medium storesexecutable instructions that when executed by at least one processor areconfigured to cause the at least one processor to receive a querysubscription to match content in a queue that includes a stream ofmessages exchanged on a messaging platform executable by a servercomputer, assign the query subscription to one or more of a plurality ofevent producers, generate, by an individual event producer, a responseevent in response to a message from the respective portion of the streamof messages including a query term of the query subscription, receive,by a collector service, status responses from the event producers andstore the status responses in a memory cache, periodically determine, bythe collector service, a health status of the query subscription byquerying the status responses in the memory cache, and, in response tothe health status being determined as repairable, obtain subscriptiondata relating to the subscription query from the memory cache, andprovide the subscription data to one or more event producers to restartthe query subscription.

According to some aspects, the non-transitory computer readable mediummay store instructions configured to provide or cause one or more of theabove/below features (or any combination thereof). The plurality ofevent producers are arranged in event producer groups, and the querysubscription is assigned to an event producer group. The querysubscription is assigned to the event producer group based on executionof a modulo operation using a user identifier associated with the querysubscription. The operations may further include publish the responseevent on a response event bus and store the response event in the memorycache. The operations may further include determine whether a number ofresponse events within a period of time has exceeded a streaming ratethreshold and discard the response event in response to the streamingrate threshold being exceeded. The operations may further includedetermine whether the message identified by the response event hasalready been published to a response event bus and discard the responseevent in response to the message being determined as already beenpublished to the response event bus. The operations may further includeinitiate transmission of a status message indicating the health statusof the query subscription. The operations may further include transmit,by a subscription executor, the query subscription to an event producermanager in response to receipt of a query subscription request receivedover a network from the client application, create, by a transportengine, a delivery channel between the transport engine and the clientapplication in response to receipt of a subscribe request received overthe network from the client application, generate, by the subscriptionexecutor, the message based on a message identifier from the responseevent and a user identifier associated with the query subscription, andstream, by the transport engine, the message to the client applicationvia the delivery channel during a period of time in which the querysubscription is active.

According to an aspect, a method for processing query subscriptions in amessaging platform may include receiving, by an event producer manager,a query subscription to match content in a queue that includes a streamof messages exchanged on a messaging platform executable by a servercomputer, assigning, by the event producer manager, the querysubscription to an event producer group of a plurality of event producergroups, each event producer group including a plurality of eventproducers, generating, by an individual event producer, a response eventin response to a message from the respective portion of the stream ofmessages including a query term of the query subscription, publishing,by a collector service, the response event to a response event bus,receiving, by the collector service, status responses from the eventproducers and store the status responses in a memory cache, periodicallydetermining, by the collector service, a health status of the querysubscription by querying the status responses in the memory cache, and,in response to the health status being determined as repairable,obtaining subscription data relating to the subscription query from thememory cache, and providing the subscription data to one or more eventproducers to restart the query subscription.

According to some aspects, the method may include one or more of theabove/below features (or any combination thereof). The querysubscription is assigned to a primary event producer group and asecondary event producer group. The query subscription is assigned tothe event producer group based on a user identifier associated with thequery subscription. The method may include determining, by the collectorservice, whether a number of response events within a period of time hasexceeded a streaming rate threshold before the publishing step, anddiscarding, by the collector service, the response event in response tothe streaming rate threshold being exceeded. The method may includedetermining, by the collector service, whether the message identified bythe response event has already been published to the response event busbefore the publishing step, and discarding, by the collector service,the response event in response to the message being determined asalready been published to the response event bus.

According to an aspect, a system for processing query subscriptions in amessaging platform includes a message queue including a stream ofmessages exchanged on the messaging platform executable by a servercomputer, an event producer configured to receive a query subscriptionand generate response events while the query subscription is active suchthat a response event is generated in response to a message of thestream of messages including a query term of the query subscription, acollector service configured to receive the response events and discardone or more of the response events to control a streaming rate at whichmessages identified by the response events are delivered to the clientapplication, and a transport engine configured to deliver, over anetwork, the messages to the client application according to thestreaming rate.

According to some aspects, the system may include one or more of theabove/below features (or any combination thereof). The collector serviceis configured to discard a new response event in response to a number ofpreviously-received response events exceeding a threshold amount over aperiod of time. The collector service is configured to publish a newresponse event to a response event bus in response to a number ofpreviously published response events being equal to or less than athreshold amount over a period of time. The collector service isconfigured to publish the response events to a response event bus andstore the published response events in a memory cache, where, inresponse to a new response event, the collector service is configured toquery the memory cache to determine the number of response events storedin the memory cache over a period of time and discard the new responseevent in response to the number of response events stored in the memorycache exceeding a threshold amount during the period of time. Eachresponse event includes a message identifier and subscription data thatincludes information about the query subscription. The system mayinclude a subscription executor configured to receive the responseevents from the collector service via a response event bus, where thesubscription executor is configured to generate a message for eachresponse event based on a message identifier included in a respectiveresponse event and a user identifier associated with the querysubscription. The collector service is configured to receive firstresponse events for a first query subscription from the event producerand receive second response events for a second query subscription fromthe event producer, where the collector service configured to discardone or more of the first response events such that messages identifiedby the first response events are streamed by the transport engine via afirst delivery channel in a manner that is equal to or less than astreaming rate threshold, and the collector service is configured todiscard one or more of the second response events such that messagesidentified by the second response events are streamed by the transportengine via a second delivery channel in a manner that is equal to orless than the streaming rate threshold.

The collector service may include a plurality of collector serviceinstances, where each collector service instance configured to receive aseparate portion of the response events and obtain a subset of responseevents by discarding one or more response events such that each subsetincludes a number of response events that is equal to or less than anindividual streaming rate threshold. The system may include a memorycache configured to store each subset of response events received from arespective collector service instance, where at least one of theplurality of collector service instance is configured to aggregate thesubsets and discard one or more response events from the aggregatedsubsets such that the aggregated subsets includes a number of responseevents that is equal to or less than a streaming rate threshold. Thecollector service is configured to receive engagement probabilitymetrics for messages identified by the response events, where theengagement probability metrics indicates predicted levels of engagementwith the messages, and the collector service is configured to discardone or more response events based on the engagement probability metrics.The collector service is configured to receive message health metricsfor messages identified by the response events, where the message healthmetrics indicates risk levels of violating one or more conditions of themessaging platform, and the collector service configured to discard oneor more response events based on the message health metrics.

According to an aspect, a non-transitory computer-readable medium storesexecutable instructions that when executed by at least one processor areconfigured to cause the at least one processor to receive a stream ofmessages exchanged on a messaging platform executable by a servercomputer, where the messaging platform is configured to deliver messagesto a user interface of a client application executable by a computingdevice, receive a query subscription for an active query on themessaging platform, generate response events while the querysubscription is active such that a response event is generated inresponse to a message of the stream of messages including a query termof the query subscription, discard one or more of the response events tocontrol a streaming rate at which messages identified by the responseevents are delivered to the client application, and deliver, over anetwork, the messages to the client application according to thestreaming rate.

According to some aspects, the non-transitory computer-readable mediummay include instructions that provide or cause one or more of theabove/below features (or any combination thereof). A newly-receivedresponse event is discarded in response to a number ofpreviously-received response events exceeding a threshold amount over aperiod of time. A newly-received response event is published to aresponse event bus in response to a number of previously publishedresponse events being equal to or less than a threshold amount over aperiod of time. The operations may further include publish the responseevents to a response event bus, store the published response events in amemory cache, and determine a number of response events stored in thememory cache over a period of time and discard a new response event inresponse to the number of response events stored in the memory cacheexceeding a threshold amount during the period of time. The operationsmay include receive the response events via a response event bus, whereeach response event includes a message identifier, and generate messagesbased on the response events such that a message is generated for eachresponse event based on a message identifier included in a respectiveresponse event and a user identifier associated with the querysubscription.

According to an aspect, a method for processing query subscriptions in amessaging platform includes receiving a stream of messages exchanged onthe messaging platform executable by a server computer, receiving aquery subscription for an active query on the messaging platform,generating response events such that a response event is generated inresponse to a message of the stream of messages including a query termof the query subscription, discarding one or more of the response eventsto control a streaming rate at which messages identified by the responseevents are delivered to the client application, where each responseevent includes a messaging identifier, generating the messages based onthe response event such that a message is generated based on the messageidentifier included within a respective response event and a useridentifier associated with the subscription query, and delivering themessages, over a network, to the client application according to thestreaming rate.

According to some aspects, the method may include one or more of theabove/below features (or any combination thereof). A newly-receivedresponse event is discarded in response to a number ofpreviously-received response events exceeding a threshold amount over aperiod of time. The method may include publishing the response events toa response event bus, storing the published response events in a memorycache, and determining a number of response events stored in the memorycache over a period of time and discard a new response event in responseto the number of response events stored in the memory cache exceeding athreshold amount during the period of time. The method may includereceiving engagement probability metrics for messages identified by theresponse events, where the engagement probability metrics indicatespredicted levels of engagements with the messages and discarding one ormore response events based on the engagement probability metrics. Themethod may include receiving message health metrics for messagesidentified by the response events, where the message health metricsindicates risk levels of violating one or more conditions of themessaging platform and discarding one or more response events based onthe message health metrics.

According to an aspect, a method for processing query subscriptions in amessaging platform to deliver real-time messages to client applicationsincludes transmitting, by a subscription executor, a query subscriptionto an event producer system in response to receipt of a querysubscription request from a client application, creating, by a transportengine, a delivery channel between the client application and thetransport engine in response to receipt of a subscribe request from theclient application, generating, at the event producer system, a responseevent in response to a message from a stream of messages having contentthat satisfies the query subscription, determining, by the subscriptionexecutor, whether an author of the message identified by the responseevent has restricted a user associated with the user identifier,discarding, by the subscription executor, the message identified by theresponse event in response to the user being determined as restricted bythe author, and streaming, by the transport engine, the messageidentified by the response event to the client application via thedelivery channel during a period of time in which the query subscriptionis active in response to the user being determined as not restricted bythe author.

According to some aspects, the method may include one or more of theabove/below features (or any combination thereof). The querysubscription request includes a query term and an expiration time. Theevent producer system includes a plurality of event producers, and themethod includes assigning the query subscription to one or more of theplurality of event producers based on the user identifier. The subscriberequest includes a transport topic and the user identifier. The methodmay include identifying, by the subscription executor, a transport topicin response to receipt of the query subscription request, generating, bythe subscription executor, a subscription identifier in response toreceipt of the query subscription request, and transmitting, over anetwork, by the subscription executor, a subscription status response tothe client application, where the subscription status response includesthe transport topic and the subscription identifier, and the subscriberequest includes the transport topic and the subscription identifier.The method may include assigning, by an event producer manager, thequery subscription to a plurality of event producers, storing the querysubscription at each of the plurality of event producers, andgenerating, by each event producer, a response event in response to amessage from the stream of messages having content that satisfies thequery subscription.

According to an aspect, a messaging platform for processing querysubscriptions to deliver real-time messages to client applicationsincludes an event producer system configured to receive a stream ofmessages exchanged on the messaging platform and generate a responseevent in response to a message from the stream of messages havingcontent that satisfies a query subscription, a subscription executorconfigured to determine whether an author of the message identified bythe response event has restricted a user associated with the querysubscription and discard the message identified by the response event inresponse to the user being determined as restricted by the author, and atransport engine configured to receive, over the network, a subscriberequest from a client application to establish a delivery channelbetween the transport engine and the client application, where thetransport engine is configured to stream the message identified by theresponse event to the client application via the delivery channel duringa period of time in which the query subscription is active in responseto the user being determined as not restricted by the author.

According to some aspects, the messaging platform may include one ormore of the above/below features (or any combination thereof). Thesubscription executor is configured to transmit the query subscriptionto the event producer system in response to receipt of a querysubscription request from the client application. The subscriptionexecutor is configured to identify a transport topic in response toreceipt of a query subscription request from the client application,where the subscription executor is configured to transmit, over thenetwork, a subscription status response to the client application, andthe subscription status response includes the transport topic. Thesubscription executor is configured to generate a subscriptionidentifier that uniquely identifies the query subscription and transmitthe subscription identifier in the subscription status response. Thesubscribe request includes a transport topic and a user identifier.

The subscription executor is connected to a response event bus to obtainthe response events as the response events are generated by the eventproducer system, each response event including a message identifier. Thesubscription executor us configured to generate the message based on themessage identifier, where the subscription executor is configured toprovide the message to the transport engine for delivery to the clientapplication via the delivery channel. The subscription executor includesa GraphQL application programming interface (API) and a GraphQLexecutor. The GraphQL executor is configured to communicate with theGraphQL API to generate a JavaScript object notation (JSON) message foreach response event. The GraphQL executor is configured to provide theJSON message to the transport engine for delivery to the clientapplication via the delivery channel. The event producer system includesan event producer manager and a plurality of event producers, where theevent producer manager is configured to receive the query subscriptionfrom the subscription executor and assign the query subscription to oneor more event producers of the plurality of event producers.

According to an aspect, a non-transitory computer-readable medium storesexecutable instructions that when executed by at least one processor areconfigured to cause the at least one processor to transmit, by asubscription executor, a query subscription to an event producer systemin response to receipt of a query subscription request from a clientapplication, create, by a transport engine, a delivery channel betweenthe client application and the transport engine in response to receiptof a subscribe request from the client application, generate, at theevent producer system, a response event in response to a message from astream of messages having content that satisfies the query subscription,determine, by the subscription executor, whether an author of themessage identified by the response event has restricted a userassociated with the user identifier, discard, by the subscriptionexecutor, the message identified by the response event in response tothe user being determined as restricted by the author, and stream, bythe transport engine, the message identified by the response event tothe client application via the delivery channel during a period of timein which the query subscription is active in response to the user beingdetermined as not restricted by the author.

According to some aspects, the non-transitory computer-readable mediummay store instructions that provide one or more of the above/belowfeatures (or any combination thereof). The query subscription requestincludes a query term and an expiration time, where the subscriberequest includes a transport topic, and the delivery channel isassociated with the transport topic such that messages are streamed tothe client application corresponding to the transport topic. Theoperations may include identify, by the subscription executor, atransport topic based on subscription data included in the querysubscription request, generate, by the subscription executor, asubscription identifier based on the subscription data, and transmit,over a network, by the subscription executor, a subscription statusresponse to the client application, where the subscription statusresponse includes the transport topic and the subscription identifier.The subscribe request includes the transport topic and the subscriptionidentifier. The operations may include assign the query subscription toone or more event producers of the event producer system, store thequery subscription at each assigned event producer, and generate, byeach event producer, a response event in response to a query term of thequery subscription being matched against a message from the stream ofmessages.

According to an aspect, a method of processing query subscriptions forstreaming real-time messages from a messaging platform includestransmitting, by a client application, a query subscription request,over a network, to a subscription executor of the messaging platform,where the query subscription request is configured to cause thesubscription executor to generate a query subscription to be executed ona queue of messages exchanged on the messaging platform, transmitting,by the client application, a subscribe request, over the network, to atransport engine of the messaging platform, where the subscribe requestis configured to cause the transport engine to create a delivery channelbetween the transport engine and the client application, receiving, bythe client application, a stream of messages that satisfy a criteria ofthe query subscription via the delivery channel such that messages arestreamed on a user interface of the client application while the querysubscription is active, and periodically transmitting, by the clientapplication, a subscribe renew request, over the network, to thetransport engine, where the subscribe renew request is configured tocause the transport engine to renew the delivery channel and cause thesubscription executor to renew the query subscription.

According to some aspects, the method may include one or more of theabove/below features (or any combination thereof). The querysubscription request includes a query term and a user identifier. Thequery subscription request includes an expiration time defining a periodof time in which the query subscription is active. The subscribe requestincludes a transport topic, where the transport topic corresponds to oneor more query terms associated with the query subscription. The methodmay include receiving, by the client application, a subscription statusresponse, over the network, from the subscription executor, where thesubscription status response includes a transport topic and asubscription identifier, and generating, by the client application, thesubscribe request to include the transport topic and the subscriptionidentifier. The query subscription request and the subscribe request aretransmitted substantially in parallel with each other. The method mayinclude receiving, by the client application, a channel identifier fromthe transport engine, the channel identifier identifying the deliverychannel. The stream of messages is rendered on a timeline of the clientapplication such that the messages are automatically streamed on thetimeline over time. The timeline is a search column on the userinterface of the client application, where the method further includesgenerating, by the client application, the query subscription request inresponse to the creation of the search column. The timeline is a hometimeline of a user of the client application such that the messages areautomatically streamed to the home timeline of the user. The stream ofmessages includes messages within a conversation graph relating to aconversation on the messaging platform.

According to an aspect, a non-transitory computer-readable medium storesexecutable instructions that when executed by at least one processor areconfigured to cause the at least one processor to transmit, by a clientapplication executable by a computing device, a query subscriptionrequest, over a network, to a subscription executor of a messagingplatform executable by a server computer, where the query subscriptionrequest is configured to cause the subscription executor to generate aquery subscription to be executed on a queue of messages exchanged onthe messaging platform, receive, by the client application, a statusmessage response, over the network, from the subscription executor,where the status message response includes a transport topic, transmit,by the client application, a subscribe request, over the network, to atransport engine of the messaging platform, where the subscribe requestincludes the transport topic, and the subscribe request is configured tocause the transport engine to create a delivery channel between thetransport engine and the client application, receive, by the clientapplication, a stream of messages that satisfy criteria of the querysubscription via the delivery channel such that messages are streamed ona user interface of the client application at a streaming rate equal toor below a streaming rate threshold while the query subscription isactive, and periodically transmit, by the client application, asubscribe renew request, over the network, to the transport engine,where the subscribe renew request is configured to cause the transportengine to renew the delivery channel and cause the subscription executorto renew the query subscription.

According to some aspects, the non-transitory computer-readable mediummay store instructions that provide one or more of the above/belowfeatures (or any combination thereof). The query subscription requestincludes a query term, a user identifier, and an expiration timedefining a period of time in which the query subscription is active. Thequery subscription request is a GraphQL subscription query. Theoperations may include receive, by the client application, a statusmessage, over the network, from the transport engine via the deliverychannel, and re-transmit, by the client application, the querysubscription request and the subscribe request based on the statusmessage.

According to an aspect, a system for processing query subscriptions forstreaming real-time messages from a messaging platform includes amessaging platform, executable by a server computer, configured togenerate a queue of messages exchanged on the messaging platform, and aclient application, executable by a computing device, configured torender a timeline of social content on a user interface of the clientapplication. The client application configured to transmit a querysubscription request, over a network, to a subscription executor of themessaging platform, where the query subscription request is configuredto cause the subscription executor to generate a query subscription tobe executed on the queue of messages, transmit a subscribe request, overthe network, to a transport engine of the messaging platform, where thesubscribe request is configured to cause the transport engine to createa delivery channel between the transport engine and the clientapplication, receive a stream of messages that satisfy criteria of thequery subscription via the delivery channel such that the messages arestreamed on a user interface of the client application at a streamingrate equal to or below a streaming rate threshold while the querysubscription is active, and periodically transmit a subscribe renewrequest, over the network, to the transport engine, where the subscriberenew request is configured to cause the transport engine to renew thedelivery channel and cause the subscription executor to renew the querysubscription.

According to some aspects, the system may include one or more of theabove/below features (or any combination thereof). The querysubscription request is a GraphQL subscription query including a queryterm and a user identifier. The subscribe request includes a transporttopic, where the transport topic corresponds to a query term, and thetransport topic has a format compatible with the transport engine. Thequery subscription request and the subscribe request are transmittedsubstantially in parallel with each other. The client application isconfigured to automatically render the stream of messages on thetimeline while the query subscription is active. The stream of messagesincludes messages related to a conversation, and the client applicationis configured to push the messages related to the conversation on theuser interface as the message are generated and shared by the messagingplatform.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a system for streaming real-timemessages over time to client applications according to querysubscriptions that match content from a message stream having messagesexchanged on a messaging platform according to an aspect.

FIG. 2 illustrates a portion of the system depicting a transport engine,a subscription executor, and a client application for the generation ofquery subscriptions according to an aspect.

FIG. 3 illustrates a portion of the system depicting an event producersystem and the subscription executor for implementing the querysubscription and generating response events according to an aspect.

FIG. 4 illustrates a portion of the system depicting the subscriptionexecutor and the transport engine for delivering delivery events to thetransport engine according to an aspect.

FIG. 5 illustrates a portion of the system depicting the transportengine and the client application for streaming messages according to anaspect.

FIG. 6 illustrates a portion of the system depicting the event producersystem, the subscription executor, the transport engine, and the clientapplication for renewing the query subscription according to an aspect.

FIG. 7 illustrates an example of a user interface of the clientapplication providing multiple timelines for streaming content accordingto an aspect.

FIG. 8 illustrates a flowchart depicting example operations of amessaging platform for streaming messages according to querysubscriptions according to an aspect.

FIG. 9 illustrates a flowchart depicting example operations of a clientapplication for steaming messages according to query subscriptionsaccording to an aspect.

FIG. 10A illustrates a schematic diagram of a system for streamingreal-time messages over time to client applications according to querysubscriptions that match content from a message stream having messagesexchanged on a messaging platform according to an aspect.

FIG. 10B illustrates an example of an event producer system according toan aspect.

FIG. 11 illustrates an example of a collector service of the eventproducer system according to an aspect.

FIG. 12 illustrates an example of a collector service having multiplecollector service instances according to an aspect.

FIG. 13 illustrates a flowchart depicting example operations of an eventproducer system according to an aspect.

FIG. 14 illustrates a flowchart depicting example operations of amessaging platform for streaming messages below a threshold levelaccording to an aspect.

DETAILED DISCLOSURE

FIG. 1 is a schematic diagram of a system 100 including a messagingplatform 104 executable by one or more server computers 102, and aclient application 126 executable by a computing device 124 according toan aspect. The messaging platform 104 is configured to stream real-timemessages 132 over time to client applications 126 according to querysubscriptions 141 that match content from a message stream 114 in amanner that increases the speed of message delivery, effectivelycontrols the management of computer resources to handle the fluctuationof the number of active query subscriptions 141, and/or increases thesecurity of matching the query subscriptions 141 and delivering thosemessages 132 in real-time from the perspective of the users thatinitiated the query subscriptions 141.

The messaging platform 104 is a platform for facilitating real-timecommunication between user devices (one of which is shown as computingdevice 124). The messaging platform 104 may store millions of accountsof individuals, businesses, and/or entities (e.g., pseudonym accounts,novelty accounts, etc.). One or more users of each account may use themessaging platform 104 to send messages to other accounts inside and/oroutside of the messaging platform 104. The messaging platform 104 may beconfigured to enable users to communicate in “real-time”, i.e., toconverse with other users with minimal delay and to conduct aconversation with one or more other users during simultaneous sessions.In other words, the messaging platform 104 may allow a user to broadcastmessages 132 and may display the messages 132 to one or more other userswithin a reasonable time frame to facilitate a live conversation betweenusers. In some examples, recipients of a message 132 may have apredefined graph relationship in a connection graph 169 with an accountof the user broadcasting the message 132.

The client application 126 is configured to communicate with themessaging platform 104 over a network 150. The client application 126may be a social media messaging application in which users post andinteract with messages 132. In some examples, the client application 126is a native application executing on an operating system of thecomputing device 124 or may be a web-based application executing on theserver computer 102 (or other server) in conjunction with abrowser-based application of the computing device 124. The computingdevice 124 may access the messaging platform 104 via the network 150using any type of network connections and/or application programminginterfaces (APIs) in a manner that permits the client application 126and the messaging platform 104 to communicate with each other.

The messages 132 may refer to message creation events such as thecreation and posting of new messages to the messaging platform 104. Insome examples, the messages 132 may refer to re-share events such as there-sharing of previously posted messages on the messaging platform 104.In some examples, the messages 132 may refer to engagement events suchas the favoritizing or liking of previously posted messages on themessaging platform 104.

The messaging platform 104 includes a subscription executor 116, anevent producer system 106, and a transport engine 122. The subscriptionexecutor 116 receives, over the network 150, a query subscriptionrequest 140 from the client application 126 and send a querysubscription 141 to the event producer system 106 to generate responseevents 156 such that a response event 156 is generated in response to amessage from the message stream 114 satisfying criteria of the querysubscription 141. The transport engine 122 receives, over the network150, a subscribe request 154 from the client application 126 toestablish a delivery channel 125 between the transport engine 122 andthe client application 126 such that messages 132 satisfying thecriteria of the query subscription 141 are stream via the deliverychannel 125, to the client application 126 in response to the responseevents 156 being generated during a period of time in which the querysubscription 141 is active.

In some examples, the messages 132 are streamed to one or more timelines130. In some examples, the messages 132 are streamed in chronologicalorder on the timeline 130. In some examples, the messages 132 arestreamed in reverse-chronological order on the timeline 130. In someexamples, the messages 132 are ranked on the timeline 130. In someexamples, the messages 132 are not ranked on the timeline 130. In someexamples, the timeline 130 is a column (e.g., a search column) on theuser interface 128 that streams messages 132 in real-time that matchesthe search criteria. For example, the user may use the clientapplication 126 to submit an active query to obtain messages 132including the search term “dog,” and the client application 126 streamsthe messages 132 on the timeline 130 that include the search term “dog”until the active query expires (e.g., the user performs an action toclose the query or the active query times out).

In some examples, the timeline 130 is a home timeline of the useraccount in which the client application 126 streams messages 132 inreal-time from user accounts linked to the user account in theconnection graph 169 stored at the messaging platform 104. In someexamples, timeline 130 is a direct message timeline in which the clientapplication 126 streams messages 132 sent directly to the user. In someexamples, the stream of messages 132 include messages within aconversation graph 167 relating to a conversation on the messagingplatform 104. The conversation graph 167 may define a reply structure ofmessages 132 relating to a conversation. In some examples, the messages132 relating to the conversation may be automatically pushed to the userinterface 128 as users are replying to messages 132 in the conversationgraph 167.

As discussed herein, the management of query subscriptions 141 isseparated from the delivery of the messages 132 by using two separatemodules, e.g., the subscription executor 116 and the transport engine122. For example, the client application 126 transmits two requests tothe messaging platform 104 to initiate receiving real-time messages 132,e.g., one directed to the subscription executor 116 for querysubscription generation, and other one directed to the transport engine122 to establish a delivery channel 125 to receive the messages 132. Thesubscription executor 116 receives the query subscription request 140from the client application 126 to implement the query subscription 141at the event producer system 106, and the transport engine 122 receivesthe subscribe request 154 from the client application 126 to establishthe delivery channel 125 in which messages 132 identified by the eventproducer system 106 are streamed to the client application 126.

The subscription executor 116 may be a query language processorconfigured to receive a query request and generate a query response suchas a JavaScript Object Notation (JSON) response. Generally, thesubscription executor 116 receives, over the network 150, querysubscription requests 140 from the client application 126, and generatesand sends the query subscriptions 141 to the event producer system 106in response to the query subscription requests 140. The subscriptionexecutor 116 subscribes to a response event bus 123 to receive theresponse events 156 from the event producer system 106, generates (e.g.,hydrates and applies visibility rules to) the messages 132 based on theresponse events 156 (thereby obtaining messages 132 with the perspectiveof the user), and publishes the messages 132 on a delivery event bus 121that are provided to the transport engine 122 for delivery to the clientapplication 126.

In some examples, the subscription executor 116 includes a data queryapplication programming interface (API) 118 and a data query executor120. The data query API 118 is communicatively connected to the dataquery executor 120. In some examples, the data query API 118 is aGraphQL API. In some examples, the data query executor 120 is a GraphQLexecutor. GraphQL may specific three operation types such as query,mutation, and subscription. In some examples, the data query API 118includes a library (e.g., a GraphQL library) configured to support thesubscription operations. The data query API 118 communicates with theclient application 126 over a network connection (e.g., a HTTPconnection) to receive and transmit information related to thegeneration and management of the query subscriptions 141. In someexamples, the data query API 118 includes an endpoint (e.g., a thriftendpoint) that is used by the data query executor 120 to execute queriesagainst response events 156 received from the event producer system 106.

The data query executor 120 monitors and receives the response events156 from the event producer system 106 via the response event bus 123,delivers the response events 156 to the data query API 118 via theendpoint, receives the full messages 132 from the data query API 118,and publishes delivery events 160 having the messages 132 to thedelivery event bus 121 to be provided to the transport engine 122 fordelivery to the client application 126. In some examples, the responseevent bus 123 and the delivery event bus 121 are separate distributedqueue systems in which subscribers subscribe to the buses to receiveevents (e.g., the transport engine 122 subscribes to the delivery eventbus 121, and the data query executor 120 subscribes to the responseevent bus 123). Also, as further described later in the disclosure, thedata query executor 120 may manage subscription renews.

The transport engine 122 is the delivery mechanism for streaming themessages 132 to the client application 126. The transport engine 122 iscommunicatively connected to the client application 126 over the network150. The transport engine 122 communicates with the client application126 over a network connection (e.g., a HTTP connection) to receive andtransmit information related to the generation of a delivery channel 125established between the transport engine 122 and the client application126. As the transport engine 122 receives a delivery event 160, thetransport engine 122 streams the message 132 included in the deliveryevent 160 over the delivery channel 125. Further, the transport engine122 receive subscription renewal requests from the client application126 to renew the query subscriptions 141, which are provided to thesubscription executor 116 and then to the event producer system 106 torenew the query subscriptions 141.

The event producer system 106 is configured to support streamingsearch-query-results by matching queries against messages of the messagestream 114 of the message queue 112. The event producer system 106 mayinclude an event producer manager 108, one or more event producers 110,and a collector service 170. In some examples, the event producermanager 108 is an API. The event producer manager 108 is configured tocommunicate with the data query API 118 of the subscription executor 116to receive new query subscriptions 141. The event producer manager 108may receive a query subscription 141 and assign the query subscription141 to one or more of the event producers 110. For example, the eventproducer manager 108 may receive a query subscription 141 and assign thequery subscription 141 to an event producer 110 (or a group of eventproducers 110) such that the query subscription 141 is stored at theevent producer 110 (or at each event producer 110 in the group).

The event producer(s) 110 receives the message stream 114 from themessage queue 112 and identifies messages 132 that meet the searchcriteria of the query subscription 141. In some examples, the messagestream 114 is a large stream of all the message 132 generated on themessaging platform 104. In some examples, the message stream 114includes messages delivered at a rate over 10 k messages per second. Insome examples, the message stream 114 includes messages delivered at arate over 25 k messages per second. In some examples, the message stream114 includes messages delivered at a rate over 50 k messages per second.In some examples, the message stream 114 includes message creationevents for messages created and posted on the messaging platform 104,message re-share events for existing messages that are re-shared on themessaging platform 104, and/or engagement events for existing messagesthat are favoritized or liked on the messaging platform 104.

FIG. 2 illustrates the system 100 depicting the operations of querysubscription generation in further detail according to an aspect.Referring to FIGS. 1 and 2, the client application 126 may generate aquery subscription request 140 and transmit, over the network, the querysubscription request 140 to the data query API 118 of the subscriptionexecutor 116. In some examples, a user may the user interface 128 of theclient application 126 to submit an active query, and, in response tothe submission of the active query, the client application 126 maygenerate and send the query subscription request 140. In some examples,the query subscription request 140 is configured to initiate a new querysubscription 141 and initiate the implementation of the querysubscription 141 at the event producer system 106. In some examples, thequery subscription request 140 is a GraphQL subscription query overhypertext transfer protocol (HTTP).

The query subscription request 140 may include subscription data 142.The subscription data 142 includes one or more query terms 144 and auser identifier 146 of a user. In some examples, the query terms 144include search terms provided by the user. In some examples, thesubscription data 142 includes variables and one or more operationnames. In some examples, the subscription data 142 includes a clientapplication identifier, and an authenticated user identifier. In someexamples, the query subscription request 140 includes an expiration time148 that indicates a time value in which the query subscription 141 isactive. If the amount of time exceeds the expiration time 148, the querysubscription 141 may be considered timed-out (unless a renew request isreceived). In some examples, the client application 126 determines avalue for the expiration time 148, which may be dependent upon theamount of time and/or the number of renewed subscriptions that have beensent by the client application 126.

In response to receipt of the query subscription request 140, thesubscription executor 116 identifies a transport topic 134 based on thequery term(s) 144 of the subscription data 142. The transport topic 134may be a descriptive and/or numerical identifier that is detectable bythe transport engine 122. In some examples, the subscription executor116 identifies the transport topic 134 using a topic library 135 thatdefines a plurality of transport topics. For example, the subscriptionexecutor 116 may identify one of the plurality of transport topics inthe topic library 135 that corresponds to the query term(s) 144. In someexamples, if the subscription executor 116 cannot identify a transporttopic 134 from the topic library 135 using the query term(s) 144, thesubscription executor 116 may generate and send a response indicatingthat the query subscription 141 has failed. In some examples, the dataquery API 118 identifies the transport topic 134 using the subscriptiondata 142. In some examples, the data query executor 120 identifies thetransport topic 134 using the subscription data 142.

In response to receipt of the query subscription request 140, thesubscription executor 116 may generate a subscription identifier 136based on the subscription data 142. The subscription identifier 136 maybe an identifier that identifies the query subscription 141. In someexamples, the data query API 118 generates the subscription identifier136. In some examples, the data query executor 120 generates thesubscription identifier 136. In some examples, the subscription executor116 may generate the subscription identifier 136 based on the useridentifier 146, the query term(s) 144 and/or other information includedin the subscription data 142 such as variables, operation name(s)), theauthenticated user identifier, and/or the client application identifier.In some examples, the subscription executor 116 is configured toserialize and hash the subscription data 142 to generate thesubscription identifier 136.

The data query API 118 is configured to transmit, over the network 150,a subscription status response 152 to the client application 126. Thesubscription status response 152 includes the transport topic 134. Insome examples, the subscription status response 152 includes thesubscription identifier 136. In some examples, the subscription statusresponse 152 includes a status message indicating whether the querysubscription request 140 is successful.

Upon receipt of the subscription status response 152, the clientapplication 126 may generate and transmit a subscribe request 154, overthe network 150, to the transport engine 122. The subscribe request 154includes the transport topic 134. In some examples, the clientapplication 126 uses the transport topic 134 identified in thesubscription status response 152 for the subscribe request 154. In someexamples, the client application 126 identifies the transport topic 134using the subscription data 142 in the same manner as the subscriptionexecutor 116. In some examples, the subscribe request 154 includes thesubscription identifier 136. In some examples, the subscribe request 154includes the user identifier 146. In some examples, the clientapplication 126 transmits the subscribe request 154 in response toreceipt of the subscription status response 152. In some examples, theclient application 126 transmits the subscribe request 154 substantiallyin parallel with the transmission of the query subscription request 140.In some examples, the client application 126 sends the querysubscription request 140 and then sends the subscribe request 154 withina period of less than 500 ms from the transmission of the querysubscription request 140. In some examples, the client application 126sends the query subscription request 140 and then sends the subscriberequest 154 within a period of 100-200 ms after sending the querysubscription request 140.

In response to the subscribe request 154, the transport engine 122establishes a delivery channel 125 with the client application 126 tostream the messages 132 to the client application 126. The deliverychannel 125 is associated with the transport topic 134 such thatmessages 132 delivered over the delivery channel 125 correspond to thetransport topic 134. In some examples, the transport engine 122subscribes the client application 126 to the transport topic 134corresponding to the user identifier 146 and the query term 144 (and/ora contributor identifier). The delivery channel 125 remains open andactive while the query subscription 141 is active. In some examples, thetransport engine 122 assigns a channel identifier to the deliverychannel 125. In some examples, the transport engine 122 sends, over thenetwork 150, the channel identifier to the client application 126. Theclient application 126 may periodically re-subscribe (e.g., everytwo-minutes) to the delivery channel 125. The client application 126 mayautomatically send a re-subscribe request in response to the query beingactive (e.g., a visible search column is displayed on the user interface128). If the query ends (e.g., a column is scrolled off the userinterface 128), the client application 126 may send a message to thetransport engine 122 to unsubscribe from the transport topic 134,thereby closing the delivery channel 125.

FIG. 3 illustrates the system 100 depicting example operations of theevent producer system 106 and the subscription executor 116 to configurethe query subscription 141 at the event producer system 106 and receiveresponse events 156 from the event producer system 106 according to anaspect. FIG. 4 illustrates the system 100 depicting example operationsof the subscription executor 116 and the transport engine 122 to deliverdelivery events 160 to the transport engine 122.

In response to receipt of the query subscription request 140, the dataquery API 118 generates and sends the query subscription 141 to theevent producer manager 108. The data query API 118 may send the querysubscription 141 as a thrift request to the event producer manager 108.A thrift request may be a remote procedure call system that is used tocommunicate between various components of the messaging platform 104.The query subscription 141 includes the subscription data 142 (e.g.,which may include the query term(s) 144), and the user identifier 146).In some examples, the query subscription 141 includes the subscriptionidentifier 136. In some examples, the query subscription 141 includesthe expiration time 148. In some examples, the query subscription 141sent to the event producer manager 108 may include the user identifier146 and other subscription related data to enable the event producersystem 106 to return them in the response events 156 to provide enoughcontext to hydrate and route the messages 132 identified by the responseevents 156. The event producer manager 108 may use the expiration time148 to determine whether the query subscription 141 has timed-out. Forexample, if the time has exceeded the expiration time 148, the eventproducer manager 108 may instruct the event producer 110 to delete thequery subscription 141, thereby saving resources for other querysubscriptions 141.

The event producer manager 108 assigns the query subscription 141 to anevent producer 110 (or a group of event producers 110). In someexamples, the event producer manager 108 assigns the query subscription141 based on the user identifier 146. The query subscription 141 isstored at the event producer 110 (or each event producer 110 in thegroup). The event producer 110 generates the response events 156 suchthat a response event 156 is generated in response to a message from themessage stream 114 being determined as containing a query term 144 ofthe query subscription 141. The event producer 110 may publish theresponse events 156 to the response event bus 123.

In some examples, the collector service 170 receives the response events156 and publishes the response events 156 to the response event bus 132.In some examples, as discussed in greater detail later in thedisclosure, the collector service 170 may de-duplicate response events156 relating to the same message 132, discard one or more responseevents 156 so that the streaming rate is below a threshold level, and/orperiodically generate status messages about the health of the querysubscriptions 141 at the event producer system 106. Each response event156 includes a message identifier 158 that uniquely identifies themessage 132 matching the query subscription 141. In some examples, eachresponse event 156 includes the subscription data 142 (e.g., queryterm(s) 144), and the user identifier 146). In some examples, eachresponse event 156 includes the subscription identifier 136. In someexamples, each response event 156 includes only the message identifier158.

The subscription executor 116 subscribes to the response event bus 123to obtain the response events 156 published by the event producer system106. Generally, the subscription executor 116 generates (e.g., hydrates)the messages 132 identified by the message identifiers 158 and appliesvisibility rules before providing the full messages 132 to the transportengine 122. In some examples, hydration may refer to the creation of themessage 132 from the message identifier 158 and the user identifier 146such that the generated message 132 has the format compatible with theclient application 126 and includes data corresponding to theperspective of the user identified by the user identifier 146. In someexamples, the subscription executor 116 is configured to generate a javascript object notation (JSON) message (e.g., the full JSON message)based on the message identifier 158 and the user identifier 146. As thesubscription executor 116 generates each message 132 corresponding to arespective response event 156, the subscription executor 116 published adelivery event 160 that includes the message 132 to the delivery eventbus 121.

During message hydration, the subscription executor 116 may discard aresponse event 156 if the subscription executor 116 determines that themessage 132 identified by the message identifier 158 violates avisibility rule, thereby improving the security of the messagingplatform 104 while being able to deliver real-time messages 132 to theclient application 126. For example, if the response event 156identifies a message 132 authored by a user that restricted (e.g.,blocked or muted) the user identified by the user identifier 146, thesubscription executor 116 may discard the response event 156.

The data query executor 120 subscribes to the response event bus 123.The data query executor 120 may monitor the response event bus 123 toobtain any response events 156 published to the response event bus 123by the event producers 110. The data query executor 120 may communicatewith the data query API 118 to generate the message 132 in response toeach response event 156 obtained from the response event bus 123. Insome examples, the data query API 118 may receive both a query and anevent and uses the event as the basis for the query execution.

For example, for a response event 156, the data query executor 120 maydeliver the message identifier 158 and subscription metadata (e.g., thesubscription data 142 and/or subscription identifier 136) to the dataquery API 118. In some examples, the data query executor 120 executes athrift request to the data query API 118 to deliver the messageidentifier 158 and the subscription metadata. The data query API 118extracts data from the message identifier 158 and the subscriptionmetadata and executes the original query subscription 141 against theresponse event 156 to generate the message 132 (e.g., the full JSONmessage). The data query executor 120 receives the execution results(e.g., the message 132) from the data query API 118 and publish adelivery event 160 on the delivery event bus 121. As shown in FIG. 4,the delivery event 160 includes the message 132. In some examples, thedelivery event 160 includes transport topic data 162 that identifies thetransport topic 134.

The transport engine 122 subscribes to the delivery event bus 121 tomonitor and obtain delivery events 160 published by the data queryexecutor 120. For example, when a delivery event 160 is published to thedelivery event bus 121, the transport engine 122 obtains the deliveryevent 160 and determines which delivery channel 125 to stream themessage 132 included within the delivery event 160 based on achannel-topic mapping 164 that maps delivery channels 125 to transporttopics 134. For example, the transport topic data 162 may identify thetransport topic 134 associated with the message 132, and the transportengine 122 may identify the appropriate delivery channel 125 to streamthe message 132 based on the channel-topic mapping 164. The transportengine 122 is configured to stream the message 132 to the clientapplication 126 over the delivery channel 125.

FIG. 5 illustrates the system 100 depicting example operations of thetransport engine 122 for multiple delivery channels 125. For example, ifthe client application 126 has established multiple query subscriptions141, the transport engine 122 creates a separate delivery channel 125for each active query subscription 141 and then delivers those messages132 over its respective delivery channel 125. For example, in responseto a query subscription 141 relating to the search term “dogs”, thetransport engine 122 transmits, over the network 150, the messages 132received from the subscription executor 116 to the client application126 via a first delivery channel 125-1 (e.g., the “dogs” deliverychannel). In response to an active query subscription 141 relating tothe search term “cats”, the transport engine 122 transmits, over thenetwork 150, the messages 132 received from the subscription executor116 to the client application 126 via a second delivery channel 125-2(e.g., the “cats” communication channel).

Although the client application 126 transmits two requests (e.g., thequery subscription request 140 and the subscribe request 154) togenerate and receive messages 132 to the messaging platform 104, in someexamples, the client application 126 may renew with one of thesubscription executor 116 or the transport engine 122. In some examples,the client application 126 renews with the transport engine 122. Forexample, the subscription to the transport topic 134 may expire after atime interval unless the subscription is renewed by the clientapplication 126 (e.g. the client application 126 must renew with thetransport engine 122 every period of time (e.g., every 2 minutes) or thequery subscription 141 expires).

FIG. 6 illustrates the system 100 depicting example operations of arenew operation according to an aspect. In some examples, thesubscription executor 116 (e.g., the data query executor 120) isconfigured manage subscription renews. For example, the clientapplication 126 may transmit, over the network 150, a subscribe renewrequest 161 to the transport engine 122 to renew the subscription to thetransport topic 134. In response to the subscribe renew request 161, thetransport engine 122 may provide transport topic data 162 to the dataquery executor 120. The transport topic data 162 may include informationabout the transport topic 134, the subscription identifier 136, and/orinformation about which event producer 110 is assigned to generateresponse events 156 for the user identifier 146. In response to thetransport topic data 162, the data query executor 120 may transmit arenew call 171 to the event producer system 106.

The event producer manager 108 may receive the renew call 171 and updatethe expiration time 148 so that the query subscription 141 is notdeleted from the event producers 110. In response to the renew call 171,the event producer manager 108 may publish a status message 166 to theresponse event bus 123, which is received by the data query executor120. The data query executor 120 may publish the status message 166 onthe delivery event bus 121 so that the transport engine 122 can deliverthe status message 166 to the client application 126.

The computing device 124 may be a mobile computing device (e.g., a smartphone, a PDA, a tablet, or a laptop computer) or a non-mobile computingdevice (e.g., a desktop computing device). The computing device 124 alsoincludes various network interface circuitry, such as for example, amobile network interface through which the computing device 124 cancommunicate with a cellular network, a Wi-Fi network interface withwhich the computing device 124 can communicate with a Wi-Fi basestation, a Bluetooth network interface with which the computing device124 can communicate with other Bluetooth devices, and/or an Ethernetconnection or other wired connection that enables the computing device124 to access the network 150.

The server computer 102 may be a single computing device or may be arepresentation of two or more distributed computing devicescommunicatively connected to share workload and resources. The servercomputer 102 may include at least one processor and a non-transitorycomputer-readable medium that stores executable instructions that whenexecuted by the at least one processor cause the at least one processorto perform the operations discussed herein.

FIG. 7 illustrates an example of the user interface 728 of the clientapplication 126 of FIG. 1 according to an aspect. The description ofFIG. 7 also references components and messages explained with referenceto FIGS. 1 through 6. In some examples, the client application 126 isconfigured to display multiple timelines as separate columns. Forexample, the user may add or remove columns, thereby adding or removingtimelines. In some examples, the addition of a column that specifies asearch initiates a query subscription 141. In some examples, the removalof a column causes the query subscription 141 to expire. In someexamples, the user may add a first column that provides a first timeline730-1. The first timeline 730-1 may display messages 732 generated by acertain user (e.g., user A) while the query subscription 141 remainsactive. For example, while the first column is displayed, any messages732 generated by user A are displayed on the first timeline 730-1. Forexample, user A may post a message 732 to the messaging platform 104 ata certain time, and the message 732 may be pushed to the first timeline130-1 around the time that the message 732 was posted such that the usercan view the newly created message 732 by user A in real-time or nearreal-time. In some examples, the first timeline 730-1 is rendered inchronological order so that the newly created message 732 is pushed tothe top of the first timeline 730-1.

In some examples, the user may add a second column that provides asecond timeline 730-2 of messages 732 that match the hashtag #GraphQL.For example, the addition of the second column indicating the searchterm “#GraphQL” initiates a query subscription 141. The second timeline730-2 may display messages 732 that include content having the searchterm “#GraphQL.” For example, while the second column is displayed, anymessages 732 exchanged on the messaging platform 104 that include thesearch term “#GraphQL” are streamed to the second timeline 730-2. Insome examples, the second timeline 730-2 is rendered in chronologicalorder so that a newly created message 732 that includes the search term“#GraphQL” is pushed to the top of the second timeline 730-2.

In some example, the user may add a third column that provides a thirdtimeline 730-3 of messages 732 that include the search term “GraphQLSummit”. For example, the addition of the third column indicating thesearch term “GraphQL Summit” initiates a query subscription 141. Thethird timeline 730-3 may display messages 732 that include content thatmatch the search term “GraphQL Summit.” For example, while the thirdcolumn is displayed, any messages 732 that match the search term“GraphQL Summit” are streamed to the third timeline 730-3 while thequery subscription 141 remains active. In some examples, the thirdtimeline 730-3 is rendered in chronological order so that a newlycreated message 732 that includes the search term “GraphQL Summit” ispushed to the top of the third timeline 730-3.

FIG. 8 illustrates a flowchart 800 depicting example operations of themessaging platform 104 for streaming real-time messages 132 according toquery subscriptions 141 according to an aspect. The flowchart 800 isdescribed with reference to the system 100 of FIGS. 1 through 6.

Operation 802 includes transmitting, by a subscription executor 116, aquery subscription 141 to an event producer system 106 in response toreceipt of a query subscription request 140 from a client application126. For example, the data query API 118 may receive the querysubscription request 140 over the network 150 from the clientapplication 126, and the data query API 118 may generate the querysubscription 141. The data query API 118 may send the query subscription141 to the event producer manager 108. In some examples, the querysubscription request 140 is a GraphQL subscription query, where the dataquery API 118 is a GraphQL API and the data query executor 120 is aGraphQL executor. In some examples, the query subscription request 140includes a query term 144 and a user identifier 146. In some examples,the data query API 118 may identify a transport topic 134 in response tothe query subscription request 140.

Operation 804 includes creating, by a transport engine 122, a deliverychannel 125 between the client application 126 and the transport engine122 in response to receipt of a subscribe request 154 received over thenetwork 150 from the client application 126. For example, the transportengine 122 may receive the subscribe request 154 over the network 150from the client application 126 and create the delivery channel 125 inresponse to receipt of the subscribe request 154.

Operation 806 includes generating, at the event producer system 106, aresponse event 156 in response to a message from a message stream 114having content that satisfies the query subscription 141. For examples,the event producer manager 108 may assign the query subscription 141 toone or more event producers 110, where each event producer 110 generatesa response event 156 when a message from the message stream 114satisfies the query subscription 141.

Operation 808 includes determining, by the subscription executor 116,whether an author of the message identified by the response event 156has restricted (e.g., blocked or muted) a user associated with the useridentifier 146, and operation 810 includes discarding, by thesubscription executor 116, the message identified by the response event156 in response to the user being determined as restricted by theauthor. For example, during message hydration, the subscription executor116 may discard a response event 156 if the subscription executor 116determines that the message 132 identified by the message identifier 158violates a visibility rule, thereby improving the security of themessaging platform 104 while being able to deliver real-time messages132 to the client application 126. For example, if the response event156 identifies a message 132 authored by a user that restricted (e.g.,blocked or muted) the user identified by the user identifier 146, thesubscription executor 116 may discard the response event 156

Operation 812 includes streaming, by the transport engine 122, themessages 132 to a user interface 128 of the client application 126 viathe delivery channel 125 during a period of time in which the querysubscription 141 is active in response to the user being determined asnot restricted by the author. For example, as the transport engine 122receives the delivery events 160, the transport engine 122 streams themessages 132 (that do not violate visibility rules), over the network150, to the client application 126.

FIG. 9 illustrates a flowchart 900 depicting example operations of theclient application 126 for generating an active query on the messagingplatform 104 and receiving a stream of messages 132 that match theactive query according to an aspect. The flowchart 800 is described withreference to the system 100 of FIGS. 1 through 6.

Operation 902 includes transmitting, by a client application 126, aquery subscription request 140, over a network 150, to a subscriptionexecutor 116 of the messaging platform 104, where the query subscriptionrequest 140 is configured to cause the subscription executor 116 togenerate a query subscription 141 to be executed on a message queue 112of messages exchanged on the messaging platform 104.

Operation 904 includes transmitting, by the client application 126, asubscribe request 154, over the network 150, to a transport engine 122of the messaging platform 104, where the subscribe request 154 isconfigured to cause the transport engine 122 to create a deliverychannel 125 between the transport engine 122 and the client application126.

Operation 906 includes receiving, by the client application 126, astream of messages 132 that satisfy criteria of the query subscription141 via the delivery channel 125 such that the messages 132 are streamedon a user interface 128 of the client application 126 over time whilethe query subscription 141 is active.

Operation 908 includes periodically transmitting, by the clientapplication 126, a subscribe renew request 161, over the network 150, tothe transport engine 122, where the subscribe renew request 161configured to cause the transport engine 122 to renew the deliverychannel 125 and cause the subscription executor 116 to renew the querysubscription 141.

For example, in response to the subscribe renew request 161, thetransport engine 122 may provide the transport topic data 162 to thedata query executor 120. In response to the transport topic data 162,the data query executor 120 may transmit the renew call 171 to the eventproducer system 106. The event producer manager 108 may receive therenew call 171 and update the expiration time 148 so that the querysubscription 141 is not deleted from the event producers 110. Inresponse to the renew call 171, the event producer manager 108 maypublish a status message 166 to the response event bus 123, which isreceived by the data query executor 120. The data query executor 120 maypublish the status message 166 on the delivery event bus 121 so that thetransport engine 122 can deliver the status message 166 to the clientapplication 126. As such, the client application 126 may renew with onlythe transport engine 122, and, as described below, the structure of themessaging platform 104 may cause the query subscription 141 to berenewed at the transport engine 122 and the subscription executor 116,thereby decreasing the amount of communication transmitted between theclient application 126 and the messaging platform 104 to maintain thequery subscription 141.

FIG. 10A is a schematic diagram of a system 1000 including a messagingplatform 1004 executable by one or more server computers 1002, and aclient application 1026 executable by a computing device 1024 accordingto an aspect. The messaging platform 1004 is configured to stream, overa network 1050, real-time messages 1032 to a client application 1026according to query subscriptions 1041 that match content from a largemessage stream 1014 of messages exchanged on the messaging platform1004. The messaging platform 1004 includes an event producer system1006, a message queue 1012 having a message stream 114, a subscriptionexecutor 1016, and a transport engine 1022. FIG. 10B illustrates theevent producer system 1006 in greater detail. The system 1000 may be anexample of the system 100 of FIGS. 1 through 6 and may include any ofthe features discussed with reference to the previous figures.

The event producer system 1006 includes an event producer manager 1008,event producers 1010 communicatively connected to the event producermanager 1008, and a collector service 1070 communicatively connected tothe event producers 1010. The event producer manager 1008 obtain querysubscriptions 1041 and configured the event producers 1010 to matchcontent from a message stream 1014 according to the criteria of thequery subscriptions 1041.

In some examples, the event producer manager 1008 is an API configuredto receive a query subscription 1041 via a thrift request. In someexamples, the event producer manager 1008 is configured to receive aquery subscription 1041 from the subscription executor 1016. The querysubscription 1041 may define criteria that is used to identify messagesfrom the message stream 1014. In some examples, the query subscription1041 is a GraphQL query subscription. The query subscription 1041includes subscription data that provides information about the querysubscription 1041. In some examples, the query subscription 1041includes one or more query terms, a user identifier, an expiration time,and/or a subscription identifier.

The event producers 1010 are arranged in event producer groups 1013 toexecute a relatively large number of query subscriptions 1041 againstthe message stream 1014. For example, the event producer system 1006 mayinclude a plurality of event producer groups 1013 such as a first eventproducer group 1013-1, a second event producer group 1013-2, a thirdevent producer group 1013-3, and a fourth event producer group 1013-4.Although four event producer groups 1013 are illustrated in FIG. 10B,the event producer groups 1013 may include any number of event producergroups 1013. Each event producer group 1013 is configured to receive thefull message stream 1014. In other words, each event producer group 1013is configured to independently monitor the full message stream 1014.Each event producer group 1013 includes a plurality of event producers1010. Although FIG. 10B illustrates four event producers 1010 withineach event producer group 1013, each event producer group 1013 mayinclude any number of event producers 1010, which may be the same ordifferent numbers across event producer groups 1013.

Each event producer 1010 within a respective event producer group 1013may receive a separate portion of the message stream 1014. For example,the message stream 1014 is divided (e.g., equally divided or unequallydivided) among the event producers 1010 within a particular eventproducer group 1013. For example, if there are four event producers 1010within the first event producer group 1013-1, a first event producerreceives a first portion of the message stream 1014, a second eventproducer receives a second portion of the message stream 1014, a thirdevent producer receives a third portion of the message stream 1014, anda fourth event producer receives a fourth portion of the message stream1014, where the first through fourth portions cover the entire messagestream 1014.

Each event producer group 1013 is allocated a portion of the querysubscriptions 1041. For example, if there are one hundred querysubscriptions 1041, twenty-five query subscriptions 1041 may beallocated to the first event producer group 1013-1, twenty-five querysubscriptions 1041 may be allocated to the second event producer group1013-2, twenty-five query subscriptions 1041 may be allocated to thethird event producer group 1013-3, and twenty-five query subscriptions1041 may be allocated to the third event producer group 1013-3. However,it is noted that the number of query subscriptions 1041 may be in thethousands or millions.

The event producer manager 1008 may receive the query subscription 1041and assign the query subscription 1041 to at least one of the eventproducer groups 1013. In some examples, the event producer manager 1008assigns the query subscription 1041 to an event producer group 1013based on a user identifier of the query subscription 1041. In someexamples, the event producer manager 1008 is configured to execute amodulo operation using the user identifier and assign the querysubscription 1041 based on the results of the modulo operation. Thequery subscription 1041 is stored at each of the event producers 1010within the assigned event producer group 1013.

In some examples, the event producer manager 1008 assigns the querysubscription 1041 to two event producer groups 1013, e.g., a primaryevent producer group and a second event producer group. For example, theevent producer manager 1008 may assign the query subscription 1041 tothe first event producer group 1013-1 and the third event producer group1013-3, where each of the event producers 1010 within the first eventproducer group 1013-1 and the third event producer group 1013-3 storesthe query subscription 1041 in memory. In this manner, if one of theevent producer groups 1013 is fails, the query subscription 1041 canstill be executed by the other event producer group 1013 assigned to thequery subscription 1041.

In some examples, the event producer manager 1008 is configured tomonitor the number of query subscriptions 1041 being assigned andexecuted for each event producer group 1013 and configured to increaseand/or decrease the number of event producer groups 1013 and/or thenumber of event producers 1010 within each event producer group 1013.For instance, in response to the number of event producers 1010 in aparticular event producer group 1013 being increased, each individualevent producer 1010 may receive fewer messages from the message stream1014 to process and consequently may have more computational capacity tohandle extra searches. In response to the number of event producergroups 1013 being increased, the number of search terms allocated to theevent producer 1010 may be reduced.

Each event producer 1010 is configured to generate a response event 156in response to the query subscription 1041 being matched against amessage from the respective portion of the message stream 1014. As shownwith respect to the previous figures, each response event 156 includes amessage identifier and subscription data providing information about thequery subscription 1041. Also, each event producer 1010 is configured toperiodically generate status responses 1075 that indicate a healthstatus of the query subscription 1041 at a respective event producer1010. Each status response 1075 may indicate whether there is an errorassociated with executing the query subscription 1041. For example, astatus response 1075 may indicate a fail status indicating that there isan error with processing the query subscription 1041 at a particularevent producer 1010, or the status response 1075 may indicate an okstatus indicating that the query subscription 1041 is properlyfunctioning at the particular event producer 1010.

As indicated above, in some examples, the query subscription 1041 isassociated with an expiration time. In some examples, the event producermanager 1008 is configured to monitor the amount of time that the querysubscription 1041 is active at the assigned event producers 1010, and ifthe time exceeds the value specified by the expiration time, the eventproducer manager 1008 may de-activate the query subscription 1041 byinstructions the assigned event producers 1010 to delete the querysubscription 1041 from memory, thereby saving resources at the eventproducer system 1006. However, the event producer manager 1008 mayreceive the renew call before the expiration time expires, which renewsthe expiration time, thereby renewing the query subscription 1041.

The collector service 1070 is configured to receive the response events1056 from the event producers 1010 and publish the response events 1056to a response event bus 1023. In some examples, the collector service1070 may determine whether the message identified by the response eventhas already been published to the response event bus 1023, and thendiscard the response event 1056 in response to the message beingdetermined as already been published to the response event bus 1023 toavoid the duplication of messages sent to the client application. Insome examples, the collector service 1070 may determine whether a numberof response events 1056 within a period of time (e.g., one second) hasexceeded a streaming rate threshold, and discard one or more responseevents 1056 (e.g., not publish one or more response events 1056 on theresponse event bus 123).

Also, the collector service 1070 is configured to receive the statusresponses 1075 from the event producers 1010 and periodically send astatus message 1066 (e.g., fail, ok, and/or renew) by publishing thestatus message on the response event bus 1023. If the status message1066 indicates an error, the client application 1026 may be required totransmit the query subscription request and the subscribe request tore-start the query subscription 1041. For example, the collector service1070 may receive the status responses 1075 from the event producers1010, determine the health status of the query subscription 1041 basedon the status responses 1075, and initiate the transmission of a statusmessage indicating the health status of the query subscription 1041.

FIG. 11 illustrates an example of a collector service 1170 according toan aspect. The collector service 1170 may be an example of the collectorservice 1070 of FIG. 10B and may include any of the features discussedwith reference to the previous figures. The collector service 1170 mayoperate in conjunction with a memory cache 1180 before publishing theresponse events 1056 to the response event bus 1023 to de-duplicatemessages 1032 identified by the response events 1056 and/or decrease astreaming rate so that the messages 1032 are delivered to the clientapplication 1026 below a streaming rate threshold 1173. In addition, thecollector service 1170 may operate in conjunction with the memory cache1180 to determine the health status of the query subscription 1041 toprovide a status message 1066 to the client application 1026 or attemptto restart the query subscription 1041.

The collector service 1170 may include a de-duplicator 1172 configuredto de-duplicate response events 1056 that identify messages 1032 alreadydelivered to the client application 1026. In some examples, the querysubscription 1041 is assigned to two event producer groups 1013 (each ofwhich receives the full message stream 1014) to protect against an eventproducer failure, which may the event producers 1010 to identifyduplicate messages 1032. However, the de-duplicator 1172 is configuredto identify duplicates so that the same message is not provided to theclient application 1026 multiple times.

As the collector service 1170 publishes a response event 1056 to theresponse event bus 1023, the collector service 1170 stores the responseevent 1056 in the memory cache 1180. In response to receipt of a newresponse event 1056, the de-duplicator 1172 determines whether a messageidentifier of the new response event 1056 is stored in the memory cache1180 by querying the memory cache 1180. In response to the messageidentifier not being stored in the memory cache 1180 (e.g., indicatingthat it is not a duplicate), the collector service 1170 publishes thenew response event 1056 on the response event bus 1023 and stores thenew response event 1056 in the memory cache 1180. In response to themessage identifier of the new response event 1056 being stored in thememory cache 1180 (e.g., indicating that it is a duplicate), thede-duplicator 1172 is configured to discard the new response event 1056.

The collector service 1170 may include a status message handler 1174configured to determine a health status for the query subscription 1041by querying the status responses 1075 in the memory cache 1180. Forexample, the collector service 1170 may receive periodically the statusresponses 1075 from the event producers 1010 and store the statusresponses 1075 in the memory cache 1180. The status message handler 1174may periodically query the memory cache 1180 to obtain the statusresponses 1075 from the memory cache 1180 from the assigned eventproducers 1010 for a particular query subscription 1041, and thentransmit a status message 1066 by publishing the status message 10066 onthe response event bus 123. In some examples, if one or more of thestatus responses 1075 indicate a fail status, the status message 1066may indicate a fail status, which may require the client application1026 to re-generate the query subscription 1041 (e.g., it may berequired to transmit the query subscription request and the subscriberequest). If most or all of the status responses 1075 indicate an okstatus, the status message 1066 may indicate an ok status.

In some examples, the collector service 1170 includes a subscriptionrestarter 1176 configured to restart the query subscription 1041 at theevent producers 1010. If the status responses 1075 indicate that therewas an error with the query subscription 1041 at one or more of theevent producers 1010, the subscription restarter 1176 may determinewhether the query subscription 1041 is repairable based on subscriptiondata associated with the response events 1056, and, if so, thesubscription restarter 1176 may transmit the subscription data to theone or more event producers 110 reporting negative status responses1075.

In some examples, the collector service 1170 includes a quota checker1178 configured to discard one or more of the response events 1056 tocontrol a streaming rate at which messages 1032 identified by theresponse events 1056 are delivered to the client application 1026 to beequal to or less than a streaming rate threshold 1173. In some examples,the streaming rate threshold 1173 is a value in a range of threemessages per second to 20 messages per second. In some examples, thestreaming rate threshold 1173 is 10 messages per second. In someexamples, the quota checker 1178 is configured to discard a new responseevent 1056 in response to a number of previously-received responseevents 1056 exceeding a threshold amount over a period of time (e.g.,the new response event 1056 is the eleventh message in one second andthe threshold is ten messages per second). However, if the number ofpreviously-recited response events 1056 is equal to or less than athreshold amount over a period of time, the collector service 1170 maypublish the new response event 1056 to the response event bus 1023.

As indicated above, the collector service 1170 may publish the responseevents 1056 to the response event bus 1023 and store the publishedresponse events 1056 in the memory cache 1180. In response to a newresponse event 1056, the quota checker 1178 may query the memory cache1180 to determine the number of response events 1056 stored at thememory cache 1180 over a period of time, and then discard the newresponse event 1056 in response to the number of response events 1056stored in the memory cache 1180 exceeding a threshold amount over aperiod of time.

In some examples, the quota checker 1178 is configured to receiveengagement probability metrics 1177 for messages 1032 identified by theresponse events 156, where the engagement probability metrics 1177indicate predicted levels of engagement with the messages 1032. Thequota checker 1178 is configured to discard one or more response events1056 based on the engagement probability metrics 1177 such that thestreaming rate is equal to or less than the streaming rate threshold1173. For example, users may engage with the messages 1032 byfavoritizing, re-sharing, and/or commenting on the messages 1032, whichmay be considered positive outcomes. In some examples, the messagingplatform 1004 may include machine-learning resources that predict thelevel of positive engagement with messages 1032 to be delivered to theuser (e.g., how likely will the user engage (e.g., favoritize, re-share,and/or comment) with the message 1032), and the quota checker 1178 mayreceive those engagement probability metrics 1177. If an engagementprobability metric 1177 for a particular message 1032 is below athreshold level, the quota checker 1178 may discard that message 1032 inorder to control the streaming rate. In some examples, the engagementprobability metrics 1177 includes predicted negative outcomes, e.g., theprobability that the user might find the message 1032 abusive. In theseexamples, based on the engagement probability metrics 1177, the quotachecker 1178 may discard the messages 1032 having a higher likely ofbeing considered as abusive (e.g., containing abusive content).

In some examples, the quota checker 1178 is configured to receivemessage health metrics 1179 for messages 1032 identified by the responseevents 1056, where the message health metrics 1179 indicate risk levelsof violating one or more conditions of the messaging platform 1004(e.g., abusive behavior, hateful conduct, threats, etc.). The quotachecker 1178 is configured to discard one or more response events 1056based on the message health metrics 1179 such that the streaming rate isequal to or less than the streaming rate threshold 1173.

FIG. 12 illustrates an example of the collector service 1270 accordingto an aspect. The collector service 1270 may be example of the collectorservice 1170 of FIG. 11 and may include any of the features describedwith reference to the previous figures. The collector service 1270 mayinclude a plurality of collector service instances 1271 such as a firstcollector service instance 1271-1, a second collector service instance1271-2, and a third collector service instance 1271-3. Although threecollector service instances 1271 are illustrated in FIG. 12, thecollector service 1270 may include any number of collector serviceinstances 1271. Each collector service instance 1271 may receive aseparate portion of the response events 1056 and/or the status responses1075. For example, the first collector service instance 1271-1 mayreceive a first portion of the response events 1056 and/or the statusresponses 1075, the second collector service instance 1271-2 may receivea second portion of the response events 1056 and/or the status responses1075, and the third collector service instance 1271-3 may receive athird portion of the response events 1056 and/or the status responses1075. Each collector service instance 1271 may be a separate instance ofthe collector service 1170 of FIG. 11. For example, each collectorservice instance 1271 may perform any of the operations of the collectorservice 1170 of FIG. 11. For example, each of the collector serviceinstance 1271 may include the functionalities of the de-duplicator 1172,the status message handler 1174, the subscription restarter 1176, and/orthe quota checker 1178.

In some examples, the collector service 1270 is configured to perform atwo-layer streaming rate adjustment process. For example, with respectto the first layer, each collector service instance 1271 may receive aseparate portion of the response events 1056 and obtain a subset ofresponse events 1056 by discarding one or more response events 1056 suchthat each subset includes a number of response events 10056 that isequal to or less than an individual streaming rate threshold 1284. Withrespect to the second layer, each collector service instance 1271 storesits subset in the memory cache 1180, and at least one of the collectorservice instances 1271 aggregates the subsets and discards one or moreresponse events 1056 from the aggregated subsets such that theaggregated subsets include a number of response events 1056 that isequal to or less than the streaming rate threshold 1173.

In further detail, with respect to the first layer, the first collectorservice instance 1271-1 may receive the first portion of the responseevents 1056 and obtain a first subset of those response events 1056 bydiscarding one or more response events 1056 to provide a streaming rateequal to or less than the individual streaming rate threshold 1284. Ifthe individual streaming rate threshold is four messages per second, thefirst collector service instance 1271-1 discards any messages beyondfour within one second and stores the first subset in the memory cache1180. The second collector service instance 1271-2 may receive thesecond portion of the response events 1056 and obtain a second subset ofthose response events 1056 by discarding one or more response events1056 to provide a streaming rate equal to or less than the individualstreaming rate threshold 1284. If the individual streaming ratethreshold is four messages per second, the second collector serviceinstance 1271-2 discards any messages beyond four within one second andstores the second subset in the memory cache 1180. Similarly, the thirdcollector service instance 1271-3 may receive the third portion of theresponse events 1056 and obtain a third subset of those response events1056 by discarding one or more response events 1056 to provide astreaming rate equal to or less than the individual streaming ratethreshold 1284. If the individual streaming rate threshold is fourmessages per second, the third collector service instance 1271-3discards any messages beyond four within one second and stores the thirdsubset in the memory cache 1180.

At this point, the total number of messages is twelve, and the streamingrate threshold 1173 may be ten messages per second. With respect to thesecond layer, at least one of the collector service instances 1271aggregates the first, second, and third subsets and discards one or moreresponse events 1056 from the aggregated subsets such that theaggregated subsets include a number of response events 1056 that isequal to or less than the streaming rate threshold 1173. If thestreaming rate threshold 1173 is ten messages per second, at least oneof the collector service instances 1271 discards two response events 156and publishes ten response events 1056 to the response event bus 1023.

In some examples, the collector service 1270 is configured to perform atwo-layer de-duplication process. For example, with respect to the firstlayer, each collector service instance 1271 may receive a separateportion of the response events 156 and remove any response events 1056identifying the same message 1032. Each collector service instance 1271may store its respective group of the response events 1056 in the memorycache 1180. At least one of the collector service instances 1271 mayquery the memory cache 1180 to aggregates the groups and discard anyresponse events 1056 that identify the same message 1032 from theaggregated groups.

FIG. 13 illustrates a flowchart 1300 depicting example operations of thesystem 1000 according to an aspect. Although the flowchart is discussedwith reference to the system 1000 of FIGS. 10A and 10B, the operationsof FIG. 13 may be applicable to any of the systems discussed herein.

Operation 1302 includes receiving, by an event producer manager 1008, aquery subscription 1041 to match content in a message queue 1012 thatincludes a message stream 114 of messages exchanged on a messagingplatform 1004 executable by a server computer 1002, where the messagingplatform 1004 configured to deliver messages 1032 to a user interface ofa client application 1026 executable by a computing device. 1024

Operation 1304 includes assigning, by the event producer manager 1008,the query subscription 1041 to an event producer group 1013 of aplurality of event producer groups 1013, where each event producer group1013 is configured to receive the message stream 1014 of messages fromthe message queue 1012, each event producer group 1013 includes aplurality of event producers 1010, and each event producer 1010configured to receive a separate portion of the message stream 1014 ofmessages.

Operation 1306 includes generating, by an individual event producer1010, a response event 1056 in response to a message from the respectiveportion of the message stream 114 of messages including a query term ofthe query subscription 1041.

Operation 1308 includes publishing, by a collector service 1070, theresponse event 1056 to a response event bus 1023, where the responseevent 1056 includes a message identifier for the message 1032 to bedelivered to the client application 1026.

FIG. 14 illustrates a flowchart 1400 depicting example operations of thesystem 1000 FIGS. 10A and 10B with the collector service 1170 of FIG. 11and/or the collector service 1270 of FIG. 12 according to an aspect.However, the operations of FIG. 14 may be applicable to any of thesystems discussed herein

Operation 1402 includes receiving a message stream 1014 of messagesexchanged on a messaging platform 1004 executable by a server computer1002, where the messaging platform 1004 is configured to delivermessages 1032 to a user interface of a client application 1026executable by a computing device 1024.

Operation 1404 includes receiving a query subscription 1041 for anactive query on the messaging platform 1004.

Operation 1406 includes generating response events 1056 while the querysubscription 1041 is active such that a response event 1056 is generatedin response to a message of the message stream 1014 of messagesincluding a query term of the query subscription 1041.

Operation 1408 includes discarding one or more of the response events1056 to control a streaming rate at which messages identified by theresponse events 1056 are delivered to the client application 1026 to beequal to or less than a streaming rate threshold 1173.

Operation 1410 includes delivering, over a network 1050, the messages1032 to the client application 1026 in a manner that is equal to or lessthan the streaming rate threshold 1173.

In the above description, numerous details are set forth. It will beapparent, however, to one of ordinary skill in the art having thebenefit of this disclosure, that implementations of the disclosure maybe practiced without these specific details. In some instances,well-known structures and devices are shown in block diagram form,rather than in detail, in order to avoid obscuring the description.

Some portions of the detailed description are presented in terms ofalgorithms and symbolic representations of operations on data bitswithin a computer memory. These algorithmic descriptions andrepresentations are the means used by those skilled in the dataprocessing arts to most effectively convey the substance of their workto others skilled in the art. An algorithm is here and generally,conceived to be a self-consistent sequence of steps leading to a desiredresult. The steps are those requiring physical manipulations of physicalquantities. Usually, though not necessarily, these quantities take theform of electrical or magnetic signals capable of being stored,transferred, combined, compared and otherwise manipulated. It has provenconvenient at times, principally for reasons of common usage, to referto these signals as bits, values, elements, symbols, characters, terms,numbers, or the like.

It should be borne in mind, however, that all of these and similar termsare to be associated with the appropriate physical quantities and aremerely convenient labels applied to these quantities. Unlessspecifically stated otherwise as apparent from the above discussion, itis appreciated that throughout the description, discussions utilizingterms such as “identifying,” “determining,” “calculating,” “updating,”“transmitting,” “receiving,” “generating,” “changing,” or the like,refer to the actions and processes of a computer system, or similarelectronic computing device, that manipulates and transforms datarepresented as physical (e.g., electronic) quantities within thecomputer system's registers and memories into other data similarlyrepresented as physical quantities within the computer system memoriesor registers or other such information storage, transmission or displaydevices.

Implementations of the disclosure also relate to an apparatus forperforming the operations herein. This apparatus may be speciallyconstructed for the required purposes, or it may comprise ageneral-purpose computer selectively activated or reconfigured by acomputer program stored in the computer. Such a computer program may bestored in a non-transitory computer readable storage medium, such as,but not limited to, any type of disk including floppy disks, opticaldisks, CD-ROMs and magnetic-optical disks, read-only memories (ROMs),random access memories (RAMs), EPROMs, EEPROMs, magnetic or opticalcards, flash memory, or any type of media suitable for storingelectronic instructions.

The words “example” or “exemplary” are used herein to mean serving as anexample, instance, or illustration. Any aspect or design describedherein as “example’ or “exemplary” is not necessarily to be construed aspreferred or advantageous over other aspects or designs. Rather, use ofthe words “example” or “exemplary” is intended to present concepts in aconcrete fashion. As used in this application, the term “or” is intendedto mean an inclusive “or” rather than an exclusive “or”. That is, unlessspecified otherwise, or clear from context, “X includes A or B” isintended to mean any of the natural inclusive permutations. That is, ifX includes A; X includes B; or X includes both A and B, then “X includesA or B” is satisfied under any of the foregoing instances. In addition,the articles “a” and “an” as used in this application and the appendedclaims should generally be construed to mean “one or more” unlessspecified otherwise or clear from context to be directed to a singularform. Moreover, use of the term “an implementation” or “one embodiment”or “an implementation” or “one implementation” throughout is notintended to mean the same embodiment or implementation unless describedas such. Furthermore, the terms “first,” “second,” “third,” “fourth,”etc. as used herein are meant as labels to distinguish among differentelements and may not necessarily have an ordinal meaning according totheir numerical designation.

The algorithms and displays presented herein are not inherently relatedto any particular computer or other apparatus. Various general-purposesystems may be used with programs in accordance with the teachingsherein, or it may prove convenient to construct a more specializedapparatus to perform the required method steps. The required structurefor a variety of these systems will appear from the description below.In addition, the present disclosure is not described with reference toany particular programming language. It will be appreciated that avariety of programming languages may be used to implement the teachingsof the disclosure as described herein.

The above description sets forth numerous specific details such asexamples of specific systems, components, methods and so forth, in orderto provide a good understanding of several implementations of thepresent disclosure. It will be apparent to one skilled in the art,however, that at least some implementations of the present disclosuremay be practiced without these specific details. In other instances,well-known components or methods are not described in detail or arepresented in simple block diagram format in order to avoid unnecessarilyobscuring the present disclosure. Thus, the specific details set forthabove are merely examples. Particular implementations may vary fromthese example details and still be contemplated to be within the scopeof the present disclosure.

What is claimed is:
 1. A method of processing query subscriptions forstreaming real-time messages from a messaging platform, the methodcomprising: transmitting, by a client application, a query subscriptionrequest, over a network, to a subscription executor of the messagingplatform, the query subscription request configured to cause thesubscription executor to generate a query subscription to be executed ona queue of messages exchanged on the messaging platform; transmitting,by the client application, a subscribe request, over the network, to atransport engine of the messaging platform, the subscribe requestconfigured to cause the transport engine to create a delivery channelbetween the transport engine and the client application; receiving, bythe client application, a stream of messages that satisfy a criteria ofthe query subscription via the delivery channel such that messages arestreamed on a user interface of the client application while the querysubscription is active; and periodically transmitting, by the clientapplication, a subscribe renew request, over the network, to thetransport engine, the subscribe renew request configured to cause thetransport engine to renew the delivery channel and cause thesubscription executor to renew the query subscription.
 2. The method ofclaim 1, wherein the query subscription request includes a query termand a user identifier.
 3. The method of claim 1, wherein the querysubscription request includes an expiration time defining a period oftime in which the query subscription is active.
 4. The method of claim1, wherein the subscribe request includes a transport topic, thetransport topic corresponding to one or more query terms associated withthe query subscription.
 5. The method of claim 1, further comprising:receiving, by the client application, a subscription status response,over the network, from the subscription executor, the subscriptionstatus response including a transport topic and a subscriptionidentifier; and generating, by the client application, the subscriberequest to include the transport topic and the subscription identifier.6. The method of claim 1, wherein the query subscription request and thesubscribe request are transmitted substantially in parallel with eachother.
 7. The method of claim 1, further comprising: receiving, by theclient application, a channel identifier from the transport engine, thechannel identifier identifying the delivery channel.
 8. The method ofclaim 1, wherein the stream of messages is rendered on a timeline of theclient application such that the messages are automatically streamed onthe timeline over time.
 9. The method of claim 8, wherein the timelineis a search column on the user interface of the client application,wherein the method further comprises: generating, by the clientapplication, the query subscription request in response to the creationof the search column.
 10. The method of claim 8, wherein the timeline isa home timeline of a user of the client application such that themessages are automatically streamed to the home timeline of the user.11. The method of claim 1, wherein the stream of messages includesmessages within a conversation graph relating to a conversation on themessaging platform.
 12. A non-transitory computer-readable mediumstoring executable instructions that when executed by at least oneprocessor are configured to cause the at least one processor to:transmit, by a client application executable by a computing device, aquery subscription request, over a network, to a subscription executorof a messaging platform executable by a server computer, the querysubscription request configured to cause the subscription executor togenerate a query subscription to be executed on a queue of messagesexchanged on the messaging platform; receive, by the client application,a status message response, over the network, from the subscriptionexecutor, the status message response including a transport topic;transmit, by the client application, a subscribe request, over thenetwork, to a transport engine of the messaging platform, the subscriberequest including the transport topic, the subscribe request configuredto cause the transport engine to create a delivery channel between thetransport engine and the client application, the delivery channel beingassigned to the transport topic; receive, by the client application, astream of messages that satisfy criteria of the query subscription viathe delivery channel such that messages are streamed on a user interfaceof the client application at a streaming rate equal to or below astreaming rate threshold while the query subscription is active; andperiodically transmit, by the client application, a subscribe renewrequest, over the network, to the transport engine, the subscribe renewrequest configured to cause the transport engine to renew the deliverychannel and cause the subscription executor to renew the querysubscription.
 13. The non-transitory computer-readable medium of claim12, wherein the query subscription request includes a query term, a useridentifier, and an expiration time defining a period of time in whichthe query subscription is active.
 14. The non-transitorycomputer-readable medium of claim 12, wherein the query subscriptionrequest is a GraphQL subscription query.
 15. The non-transitorycomputer-readable medium of claim 12, further comprising: receive, bythe client application, a status message, over the network, from thetransport engine via the delivery channel; and re-transmit, by theclient application, the query subscription request and the subscriberequest based on the status message.
 16. A system for processing querysubscriptions for streaming real-time messages from a messagingplatform, the system comprising: a messaging platform, executable by aserver computer, configured to generate a queue of messages exchanged onthe messaging platform; and a client application, executable by acomputing device, configured to render a timeline of social content on auser interface of the client application, the client applicationconfigured to: transmit a query subscription request, over a network, toa subscription executor of the messaging platform, the querysubscription request configured to cause the subscription executor togenerate a query subscription to be executed on the queue of messages;transmit a subscribe request, over the network, to a transport engine ofthe messaging platform, the subscribe request configured to cause thetransport engine to create a delivery channel between the transportengine and the client application; receive a stream of messages thatsatisfy criteria of the query subscription via the delivery channel suchthat the messages are streamed on a user interface of the clientapplication at a streaming rate equal to or below a streaming ratethreshold while the query subscription is active; and periodicallytransmit a subscribe renew request, over the network, to the transportengine, the subscribe renew request configured to cause the transportengine to renew the delivery channel and cause the subscription executorto renew the query subscription.
 17. The system of claim 16, wherein thequery subscription request is a GraphQL subscription query including aquery term and a user identifier.
 18. The system of claim 16, whereinthe subscribe request includes a transport topic, the transport topiccorresponding to a query term, the transport topic having a formatcompatible with the transport engine.
 19. The system of claim 16,wherein the query subscription request and the subscribe request aretransmitted substantially in parallel with each other.
 20. The system ofclaim 16, wherein the client application is configured to automaticallyrender the stream of messages on the timeline while the querysubscription is active.
 21. The system of claim 16, wherein the streamof messages includes messages related to a conversation, and the clientapplication is configured to push the messages related to theconversation on the user interface as the message are generated andshared by the messaging platform.